package serializable.msgpack;

import cn.hutool.core.collection.ListUtil;
import org.msgpack.MessagePack;
import org.msgpack.template.Templates;

import java.io.IOException;
import java.util.*;

public class Demo1 {

    public static void main(String[] args) throws IOException {

        List<String> src = new ArrayList<>();
        src.add("msgpack");
        src.add("jdk");

        MessagePack msgpack = new MessagePack();
        byte[] raw = msgpack.write(src);
        System.out.println("byte[] length : "+raw.length);

        List<String> dst = msgpack.read(raw, Templates.tList(Templates.TString));
        dst.forEach(e -> System.out.println(e));
    }
}
